<template>
  <div class="home">
    <!-- <h1>{{count}}</h1> -->
    <h1>{{this.$store.state.count}}</h1>
    <button @click="add">++</button>
    <button @click="dec">--</button>
  </div>
</template>

<script>
  export default {
    mounted() {
      console.log(this);
    },
    data() {
      return {
        // count: 0
      }
    },
    methods: {
      add() {
        // this.count++;
        // this.$store.state.count++;
        this.$store.dispatch('jiaA');
      },
      dec() {
        // this.count--;
        // this.$store.state.count--;
        this.$store.commit('jianM');
      }
    }
  }
</script>
